<%--
XPTracker - Alternative Agile Tracking Tool
Copyright (C) 2006-2009  Stephen Starkey

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
--%>
<%@ include file="taglibs.jsp" %>

<c:if test="${!empty actionBean.completed}">
  <h3>Completed</h3>
  <c:forEach items="${actionBean.completed}" var="story">
    <c:set var="effort" value="${actionBean.storyEffortEntries[story.id]}" scope="request"/>
    <c:choose>
      <c:when test="${empty effort}">
        <table class="data" style="width:1024px">
          <caption><xp:story-link story="${story}"/></caption>
          <tr>
            <td><em>No effort logged.</em></td>
          </tr>
        </table>
      </c:when>
      <c:otherwise>
        <dt:table class="data" name="effort" id="entry" style="width:1024px" requestURI="${url}" excludedParams="_sourcePage">
          <dt:caption><xp:story-link story="${story}"/></dt:caption>
          <dt:column property="user.username" style="width:6%" title="User"/>
          <dt:column property="start" style="width:12%" decorator="org.xptracker.web.EffortDateDecorator"/>
          <dt:column property="end" style="width:12%" decorator="org.xptracker.web.EffortDateDecorator"/>
          <dt:column title="Duration" style="width:20%">
            <xp:display-effort amount="${entry.duration}" stopAt="hours"/>
          </dt:column>
          <dt:column property="comment"/>
        </dt:table>
      </c:otherwise>
    </c:choose>
  </c:forEach>
</c:if>

<c:if test="${!empty actionBean.existing}">
  <h3>Not Completed</h3>
  <c:forEach items="${actionBean.existing}" var="story">
    <c:set var="effort" value="${actionBean.storyEffortEntries[story.id]}" scope="request"/>
    <c:choose>
      <c:when test="${empty effort}">
        <table class="data" style="width:1024px">
          <caption><xp:story-link story="${story}"/></caption>
          <tr>
            <td><em>No effort logged.</em></td>
          </tr>
        </table>
      </c:when>
      <c:otherwise>
        <dt:table class="data" name="effort" id="entry" style="width:1024px" requestURI="${url}" excludedParams="_sourcePage">
          <dt:caption><xp:story-link story="${story}"/></dt:caption>
          <dt:column property="user.username" style="width:6%" title="User"/>
          <dt:column property="start" style="width:12%" decorator="org.xptracker.web.EffortDateDecorator"/>
          <dt:column property="end" style="width:12%" decorator="org.xptracker.web.EffortDateDecorator"/>
          <dt:column title="Duration" style="width:20%">
            <xp:display-effort amount="${entry.duration}" stopAt="hours"/>
          </dt:column>
          <dt:column property="comment"/>
        </dt:table>
      </c:otherwise>
    </c:choose>
  </c:forEach>
</c:if>

<c:if test="${!empty actionBean.removedKeys}">
  <h3>Removed</h3>
  <c:forEach items="${actionBean.removedKeys}" var="story">
    <c:set var="effort" value="${actionBean.storyEffortEntries[story.id]}" scope="request"/>
    <c:choose>
      <c:when test="${empty effort}">
        <table class="data" style="width:1024px">
          <caption><xp:story-link story="${story}"/></caption>
          <tr>
            <td><em>No effort logged.</em></td>
          </tr>
        </table>
      </c:when>
      <c:otherwise>
        <dt:table class="data" name="effort" id="entry" style="width:1024px" requestURI="${url}" excludedParams="_sourcePage">
          <dt:caption><xp:story-link story="${story}"/></dt:caption>
          <dt:column property="user.username" style="width:6%" title="User"/>
          <dt:column property="start" style="width:12%" decorator="org.xptracker.web.EffortDateDecorator"/>
          <dt:column property="end" style="width:12%" decorator="org.xptracker.web.EffortDateDecorator"/>
          <dt:column title="Duration" style="width:20%">
            <xp:display-effort amount="${entry.duration}" stopAt="hours"/>
          </dt:column>
          <dt:column property="comment"/>
        </dt:table>
      </c:otherwise>
    </c:choose>
  </c:forEach>
</c:if>

